﻿using System;
using System.Data.Entity.ModelConfiguration.Configuration;
using ENail.Domain.Core;
using Equation.Enterprise.Framework.Domain.Model;

namespace ENail.Domain.Data.Mapping
{
    class CustomerMapping : EntityMappingWithTypedId<Customer, Int32>
    {
        public CustomerMapping(): base("Customer")
        {
            Property(x => x.Id).HasColumnName("CustomerId");
            HasRequired(x => x.NailSalon).WithMany(x => x.Customers).Map(x => x.MapKey("NailSalonId"));

            HasMany(x => x.Registrations);
        }
    }
}
